
#!/bin/bash

MODULE='my_sysctl'

MODULE_STATUS=`lsmod | grep ${MODULE}`
[ "${MODULE_STATUS}" != "" ] && sudo rmmod ${MODULE}


sudo dmesg -c > /dev/null

sudo insmod ${MODULE}.ko

echo "test_int: expect 1"
echo 1 > /proc/sys/myctl/test_int
cat /proc/sys/myctl/test_int
echo ""


echo "test_string: expect good"
echo "good" > /proc/sys/myctl/test_string
cat /proc/sys/myctl/test_string
echo ""

echo "test_diy: expect 100 and printk"
echo 100 > /proc/sys/myctl/test_diy
cat /proc/sys/myctl/test_diy
echo ""

sudo rmmod ${MODULE}
sudo dmesg | tail
